# Maintainer: Laurent Bercot <ska-devel@skarnet.org>
# Contributor: John Regan <john@jrjrtech.com>
pkgname=s6-dns
pkgver=2.3.5.4
pkgrel=0
pkgdesc="skarnet.org's DNS client libraries and command-line DNS client utilities"
url="https://skarnet.org/software/$pkgname/"
arch="all"
license="ISC"
options="!check"
makedepends="skalibs-dev>=2.12"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://skarnet.org/software/s6-dns/s6-dns-$pkgver.tar.gz"

build() {
	./configure \
		--enable-shared \
		--enable-static \
		--disable-allstatic \
		--prefix=/usr \
		--libdir=/usr/lib \
		--libexecdir="/usr/lib/$pkgname" \
		--with-dynlib=/lib
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

doc() {
	default_doc
	mkdir -p "$subpkgdir/usr/share/doc"
	cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname"
}

static() {
	default_static
	rmdir -p "$pkgdir"/usr/lib/"$pkgname" || :
}

sha512sums="
04c8fd40c71c9517f4e8d847a0ddf7d60a7759b4d7075035c2e00b4eb34e81edf4608df562929042c294ed671ab953e613374b577210ff49841ceb27dd563ae5  s6-dns-2.3.5.4.tar.gz
"
